home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00b.txt / 000116_icon-group-sender_Fri Oct 27 08:00:36 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  4KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9RExmi19487
  4.     for icon-group-addresses; Fri, 27 Oct 2000 07:59:48 -0700 (MST)
  5. Message-Id: <200010271459.e9RExmi19487@baskerville.CS.Arizona.EDU>
  6. Date: Fri, 27 Oct 2000 03:04:55 -0200
  7. From: Eduardo Nahum Ochs <edrx@mat.puc-rio.br>
  8. To: icon-group@cs.arizona.edu
  9. Subject: Re: Yet another Newbie question....
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11. Status: RO
  12. Content-Length: 3729
  13.  
  14. > This reminds of the (computer nerd) semi-joke "I can write FORTRAN
  15. > in any language". Advanced languages like Icon (and Smalltalk and
  16. > Prolog and ...) are not "conventional". Instead, they provide ways
  17. > to approach problem solutions by thinking differently - which only
  18. > works if you do think "differently". By forcing these languages to
  19. > match a conventional model you are losing most of the advantages
  20. > that the language offers. In that case, why bother with learning the
  21. > language?
  22.  
  23. Right, but it is often convenient to first learn how to translate some
  24. techniques of the languages you already know into the new language --
  25. for example basic debugging tools, to let you check which values the
  26. variables are getting, to make a program stop when reaching a point
  27. for the nth time, etc...
  28.  
  29. I think that it is much easier to start coding with a bad style and
  30. learn continuously from reading good code than to pretend that your
  31. mind got entirely blank and then try to learn a new programming
  32. language as if you were suddenly reborn in another planet - possibly a
  33. planet where some of the knowledge comes in the form of mantras like
  34. "a class is like a car, a subclass is like a car window..."
  35.  
  36. Please, no two programming languages are completely orthogonal to each
  37. other, and Icon is still made of its syntax plus the icode interpreter
  38. (let's think it low-level: interp.r) plus its primitive operations and
  39. functions...
  40.  
  41. Ok, sorry -- I'm not being ironic, it's just that something occurred
  42. to me that I haven't thought before -- now I recognize that there are
  43. people who get bad programming habits and who would never even think
  44. about getting rid of them -- and worse yet, these are exactly the
  45. "excellent programmers" that can write working 100000-line programs
  46. (these programs that are ugly and unmaintainable, but the market
  47. doesn't care). So, who are we talking about when we say "In that case,
  48. why bother with learning the language"? These people? CS students that
  49. will only use something other than Perl when really forced to? I
  50. confess that almost all professional programmers that I knew
  51. personally (obs: I live in Brazil) are on the same equivalence class
  52. as the old dogs to whom it is impossible to teach new tricks... As for
  53. me, I'm studying maths, all my attempts to program professionally
  54. always failed miserably, and for five years I used Icon for almost
  55. every one-shot program that I had to do -- and it is scaring how we
  56. can program really complex things in a just few minutes with Icon when
  57. we have enough experience.
  58.  
  59. My $0.02 on what we can do to help saving (:-) those people is just to
  60. make a certain simple piece of code standard. I used to include a file
  61. called "zinc.icn" from all my programs, and zinc.icn defined a
  62. function w and a constant NO such that "w(( expr )|NO)" was always
  63. equivalent to "expr", except maybe for some subtle differences on
  64. backtracking behavior that I never checked. But if "expr" failed then
  65. "w(( expr )|NO)" would print "failed" and fail, and if "expr" didn't
  66. fail then "w(( expr )|NO)" would print the full representation of
  67. "expr" using a recursive function, and return the value of "expr".
  68.  
  69. I can post my code for "w", but it is somewhat ugly and needs some
  70. cleaning. I also had a trivial wrapper (for Linux) that when called as
  71. "icone expr" executed
  72.  
  73.   $include "zinc.icn"
  74.   procedure main(args)
  75.     w(( expr )|NO)
  76.   end
  77.  
  78. and I can try to resurrect it; I know that I would have rolled on the
  79. floor with joy if someone had shown me these tricks before I had to
  80. write them myself, but I don't know if other people would be
  81. interested.
  82.  
  83. More on all this later; questions and flames are welcome.
  84. Cheers for now,
  85.  
  86.   Eduardo Ochs
  87.   http://angg.twu.net/
  88.   edrx@inx.com.br
  89.